<template>
  <el-scrollbar class="dashboard-container">
    <component :is="currentRole" />
  </el-scrollbar>
</template>

<script>
import adminDashboard from "./admin";
import contartDashboard from "./admin/contartal-portal";
export default {
  name: "Dashboard",
  components: { adminDashboard, contartDashboard },
  data() {
    return {
      currentRole: "adminDashboard",
    };
  },
  created() {
    this.getConponents();
  },
  methods: {
    getConponents() {
      // this.separateHandle();

      // 如果是视翰公司的，展示此home页
      if (this.$route.query.applicationId == "454556140475292421") {
        this.currentRole = "contartDashboard";
      }
    },
    separateHandle() {
      // console.log(window.location.href);
      //判断链接href是否为测试环境
      if (window.location.href.indexOf("jsbos-web-preview") != -1) {
        // this.$nextTick(() => {
        let meunDom = document.querySelector(".sidebar-container");
        let meunUlDom = document.querySelector(".el-menu");
        // logoDom.style.backgroundColor = "#033c11";
        meunDom.style.backgroundColor = "#ee5db9";
        meunUlDom.style.backgroundColor = "#ee5db9";
        // });
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.dashboard-container {
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
  >>> .el-scrollbar__wrap {
    margin-bottom: 0 !important;
    overflow-x: auto;
  }
  >>> .el-scrollbar__bar.is-horizontal > div {
    display: none;
  }
}
</style>